﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MyBlog.DataEntity;

namespace MyBlog.DataAccess
{
    internal class ArticleCommentMap : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<Tbl_ArticleComment>
    {
        public ArticleCommentMap()
        {
            this.Property(e => e.Content)
                .IsUnicode(false);

            this.HasMany(e => e.ArticleComments)
                 .WithOptional(e => e.Parent)
                 .HasForeignKey(e => e.ParentID)
                 .WillCascadeOnDelete(false);
        }
    }
}
